params = Params.parse(params, { inhibitEvents: false,
width: null,
height: null,
- fadeInTime: null,
- fadeOutTime: null,
- fadeFactor: DEFAULT_FADE_FACTOR
+ fadeFactor: DEFAULT_FADE_FACTOR,
});
this._container = container;
this._children = container.get_children();
- this._fadeInTime = params.fadeInTime;
- this._fadeOutTime = params.fadeOutTime;
this._fadeFactor = params.fadeFactor;
this.actor = new St.Bin({ x: 0,
y: 0,
}
},
- show: function() {
+ show: function(fadeInTime) {
+ fadeInTime = fadeInTime || 0;
+
Tweener.removeTweens(this.actor);
- if (this._fadeInTime) {
+ if (fadeInTime != 0) {
this.shown = false;
this.actor.opacity = 0;
Tweener.addTween(this.actor,
{ opacity: 255 * this._fadeFactor,
- time: this._fadeInTime,
+ time: fadeInTime,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this.shown = true;
this.actor.show();
},
- hide: function() {
+ hide: function(fadeOutTime) {
+ fadeOutTime = fadeOutTime || 0;
+
this.shown = false;
Tweener.removeTweens(this.actor);
- if (this._fadeOutTime) {
+ if (fadeOutTime != 0) {
Tweener.addTween(this.actor,
{ opacity: 0,
- time: this._fadeOutTime,
+ time: fadeOutTime,
transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this.actor.hide();
for (let i = 0; i < lightboxContainers.length; i++)
this._lightboxes.push(new Lightbox.Lightbox(lightboxContainers[i],
{ inhibitEvents: true,
- fadeInTime: ANIMATION_TIME,
- fadeOutTime: ANIMATION_TIME,
fadeFactor: 0.2
}));
});
for (let i = 0; i < this._lightboxes.length; i++)
- this._lightboxes[i].show();
+ this._lightboxes[i].show(ANIMATION_TIME);
return true;
},
// This is a no-op in that case.
this._grabHelper.ungrab({ actor: this.actor });
for (let i = 0; i < this._lightboxes.length; i++)
- this._lightboxes[i].hide();
+ this._lightboxes[i].hide(ANIMATION_TIME);
},
_hideDesktopClone: function() {